﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Display.DialogUI {
    import flash.display.*;
    import flash.utils.*;
    import org.aswing.*;
    import Classes.*;
    import flash.text.*;
    import org.aswing.border.*;
    import Display.aswingui.*;

    public class PotatoDonationDialogView extends GenericPictureDialogView {

        protected var m_cashCost:int;

        public function PotatoDonationDialogView(_arg1:Dictionary, _arg2:String="", _arg3:String="", _arg4:int=0, _arg5:Function=null, _arg6:String="", _arg7:int=0, _arg8:String="", _arg9:int=5){
            this.m_cashCost = _arg9;
            super(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8);
        }
        override protected function createInteriorHolder():JPanel{
            var _local10:JPanel;
            var _local1:JPanel = new JPanel(new SoftBoxLayout(SoftBoxLayout.Y_AXIS, -10, SoftBoxLayout.TOP));
            var _local2:JPanel = createHeaderPanel();
            ASwingHelper.prepare(_local2);
            textArea = ASwingHelper.makeSoftBoxJPanelVertical(SoftBoxLayout.CENTER);
            var _local3:AssetPane = ASwingHelper.makeMultilineText(ZLoc.t("Dialogs", (m_message + "_secondMessage")), 450, EmbeddedArt.DEFAULT_FONT_NAME_BOLD, TextFormatAlign.CENTER, 20, EmbeddedArt.blueTextColor);
            var _local4:JPanel = ASwingHelper.centerElement(_local3);
            ASwingHelper.setEasyBorder(_local4, 0, 10, 0, 10);
            var _local5:AssetPane = ASwingHelper.makeMultilineText(ZLoc.t("Dialogs", (m_message + "_message")), 460, EmbeddedArt.DEFAULT_FONT_NAME_BOLD, TextFormatAlign.CENTER, 14, EmbeddedArt.brownTextColor);
            var _local6:JPanel = ASwingHelper.centerElement(_local5);
            ASwingHelper.setEasyBorder(_local6, 0, 10, 0, 10);
            var _local7:AssetPane = ASwingHelper.makeMultilineText(ZLoc.t("Dialogs", (m_message + "_thirdMessage")), 450, EmbeddedArt.DEFAULT_FONT_NAME_BOLD, TextFormatAlign.CENTER, 14, EmbeddedArt.brownTextColor);
            var _local8:JPanel = ASwingHelper.centerElement(_local7);
            ASwingHelper.setEasyBorder(_local8, 0, 10, 0, 10);
            m_imagePanel = makeImagePanel();
            var _local9:JPanel = ASwingHelper.centerElement(m_imagePanel);
            ASwingHelper.setEasyBorder(_local9, 0, 20, 0, 20);
            textArea.append(_local9);
            textArea.append(_local4);
            textArea.append(_local6);
            textArea.append(_local8);
            ASwingHelper.prepare(textArea);
            _local1.setBorder(new EmptyBorder(null, new Insets(0, 0, 0, 0)));
            if (m_type != TYPE_NOBUTTONS){
                _local1.append(_local2);
            };
            _local1.append(ASwingHelper.verticalStrut(20));
            _local1.append(textArea);
            _local1.append(ASwingHelper.verticalStrut(BUTTON_MARGIN));
            if (((!((m_type == TYPE_MODAL))) && (!((m_type == TYPE_NOBUTTONS))))){
                _local10 = this.createButtonPanel();
                _local1.append(_local10);
            };
            ASwingHelper.prepare(_local1);
            _local2.setPreferredWidth(_local1.getWidth());
            ASwingHelper.prepare(_local1);
            return (_local1);
        }
        override protected function createButtonPanel():JPanel{
            var _local1:JPanel = new JPanel(new FlowLayout(AsWingConstants.CENTER));
            m_acceptTextName.toUpperCase();
            var _local2:AssetIcon = new AssetIcon((new EmbeddedArt.icon_cash_big() as DisplayObject));
            var _local3:CustomButton = new CustomButton(ZLoc.t("Dialogs", "BuyCashCropButton", {amount:this.m_cashCost.toString()}), _local2, "BigCashButtonUI");
            _local3.addActionListener(onAccept, 0, true);
            _local1.append(_local3);
            ASwingHelper.prepare(_local1);
            return (_local1);
        }

    }
}//package Display.DialogUI 
